#ifndef _FNT_OPTIONS_PAGE_H_
#define _FNT_OPTIONS_PAGE_H_

#include <QWidget>

enum class TracerState;
enum class SessionState;
class QBoxLayout;
class Options;
class OptionsDlg;
class Tracer;
class Session;

struct OptionsPagePriv;
class OptionsPage : public QWidget {
	Q_OBJECT;
	friend struct OptionsPagePriv;
	OptionsPagePriv*const priv;

Q_SIGNALS:
	void stateChanged(bool a, bool b, bool c, bool d);

	protected:
	OptionsPage(const QString& name, const QString& title);

	QBoxLayout* layout() const;
	void notifyChange();
	bool setBlocked(bool v);

	virtual void getState(bool* a, bool* b, bool* c, bool* d) const =0;
	virtual void useDefaultImp() =0;
	virtual void saveDefaultImp() =0;
	virtual void applyChangesImp() =0;
	virtual void resetChangesImp() =0;
	virtual void setStateImp(SessionState ts) =0;

	public:
	virtual ~OptionsPage();
	const QString& name() const;
	void setState(SessionState ts);
	void setState(TracerState ts);
	void useDefault();
	void saveDefault();
	void applyChanges();
	void resetChanges();


	static OptionsPage* cacheThreadOptions();
	static OptionsPage* sessionLoadingOptions();
	static OptionsPage* viewerGeneralOptions();
	static OptionsPage* sessionChannelOptions();

	//
	//


	static OptionsPage* computeGeneralOptions();
	static OptionsPage* computeFindOptions();
	static OptionsPage* computeConnOptions();
	static OptionsPage* computeRefineOptions();
	static OptionsPage* computeRefineAutoOptions();
	static OptionsPage* viewerVolumeOptions();
	static OptionsPage* viewerColorOptions();
	static OptionsPage* viewerCheckOptions();
};

#endif
